# @Time    :2025/4/9 11:55
import re


class Customer:
    def __init__(self, c_id, name, age="None", phone="None", email="None"):
        self.c_id = c_id
        self.name = name
        self.age = age
        self.phone = phone
        self.email = email

    #客户信息校验
    @staticmethod
    def check_c_id(c_id):
        return c_id.isdigit()

    @staticmethod
    def check_name(name):
        return name.isalpha()

    @staticmethod
    def check_age(age):
        return age.isdigit()

    @staticmethod
    def check_phone(phone):
        pattern = r'^1[3-9]\d{9}$'
        return True if re.match(pattern,phone) else False

    @staticmethod
    def check_email(email):
        pattern = r'^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$'
        return True if re.match(pattern, email) else False

    def __str__(self):
        return f"ID:{self.c_id:<15}name:{self.name:<15} age:{self.age:<15} phone:{self.phone:<15} email:{self.email:<15}"

# c=Customer("1","张华")
# print(c)

